package name.wilbur.course.db.bigone.model;
/**
 * @author wilbur
 */

import java.sql.Timestamp;

public class Group extends BaseDBModel {
	private String groupName;
	private int groupMembersNum;
	private Timestamp groupCreateDate;
	
	public Group() {
	}

	public Group(String groupName, int groupMembersNum,
			Timestamp groupCreateDate) {
		super();
		this.groupName = groupName;
		this.groupMembersNum = groupMembersNum;
		this.groupCreateDate = groupCreateDate;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public int getGroupMembersNum() {
		return groupMembersNum;
	}

	public void setGroupMembersNum(int groupMembersNum) {
		this.groupMembersNum = groupMembersNum;
	}

	public Timestamp getGroupCreateDate() {
		return groupCreateDate;
	}

	public void setGroupCreateDate(Timestamp groupCreateDate) {
		this.groupCreateDate = groupCreateDate;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result
				+ ((groupCreateDate == null) ? 0 : groupCreateDate.hashCode());
		result = prime * result + groupMembersNum;
		result = prime * result
				+ ((groupName == null) ? 0 : groupName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Group other = (Group) obj;
		if (groupCreateDate == null) {
			if (other.groupCreateDate != null)
				return false;
		} else if (!groupCreateDate.equals(other.groupCreateDate))
			return false;
		if (groupMembersNum != other.groupMembersNum)
			return false;
		if (groupName == null) {
			if (other.groupName != null)
				return false;
		} else if (!groupName.equals(other.groupName))
			return false;
		return true;
	}
	
}
